<script type="text/javascript" src="/sfDependentSelectPlugin/js/SelectDependiente.min.js"></script>
<script type="text/javascript" src="/sfFormExtraPlugin/js/double_list.js"></script>
<form id="formRango" action="<?php 

    if($adicional==1){
        echo url_for('dashboard/adicional');
    }else{
        echo url_for('dashboard/index');
    }


?>" method="post">
<table width="100%" cellpadding="0" cellspacing="0" border="0" id="tableRango">
    <tr>
        <td>
            <div class="title-windows">Filtros Internos
            
                <a href="javascript:void(0);" onclick="closeAll();" class="close-windows">
                    
                <img src="/images/icon/remove.png" title="Close"  />
                
                </a>
            </div>
        </td>
    </tr>
    
    
    
    <tr>
        <td class="" style="vertical-align:top; padding: 10px;">
            
            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                
                      
                     <tr>
                            <td class="form-field" style="padding-top: 0px; margin-top: 0px;">
                                
                              
                            <?php echo $filtro['busqueda']->renderLabel(); ?>:
                            <div class="clear"></div>
                            <?php echo $filtro['busqueda']; ?></div>      
                            <div class="clear" style="height: 10px"></div>
                            
                            <table width="100%" cellpadding="0" cellspacing="0" border="0" >   
                                <tr>
                                    <td>
                            
                            <?php echo $filtro['zona_id']->renderLabel(); ?>:
                            <div class="clear"></div>
                            <?php echo $filtro['zona_id']; ?></div>
                            <div class="clear" style="height: 10px"></div>
                            
                            </td>
                            <td>
                            Codigo Postal:
                            <div class="clear"></div>
                            <?php echo $filtro['cp']; ?>
                            <div class="clear" style="height: 10px"></div>
                            
                            
                                </td>
                                </tr>
                            </table>
                            
                            
                            
                            
                            
                            <?php echo $filtro['municipio_id']->renderLabel(); ?>:
                            <div class="clear"></div>
                            <?php echo $filtro['municipio_id']; ?>
                            <div class="clear" style="height: 10px"></div>
                            
                            
                            <?php echo $filtro['parroquia_id']->renderLabel(); ?>:
                            <?php echo $filtro['municipio_id']->renderError() ?>
                            <div class="clear"></div>
                            <div id="busquedaColonia"><?php echo $filtro['parroquia_id'] ?></div>
                             <div class="clear" style="height: 10px"></div>       
                                    
                            
                            
                            <?php if($adicional==1){ ?>
                            
                            
                            <table width="100%" cellpadding="0" cellspacing="0" border="0" >   
                                <tr>
                                    <td>
                            Depurados:
                            <div class="clear"></div>
                            <?php echo $filtro['depuracionind']; ?>
                                    </td>
                                    <td>
                            Alimento Capturado:
                            <div class="clear"></div>
                            <?php echo $filtro['alimento_capturado']; ?>            
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="height: 5px;"></td>
                                </tr>
                                <tr>
                                    <td>
                            <?php echo $filtro['servicio']->renderLabel(); ?>:
                            <div class="clear"></div>
                            <?php echo $filtro['servicio']; ?>
                                    </td>
                                    <td>
                            <?php echo $filtro['status']->renderLabel(); ?>:
                            <div class="clear"></div>
                            <?php echo $filtro['status']; ?>            
                                        
                                    </td>
                                </tr>
                            </table>
                            
                            
                            <?php } ?>
                    
                            </td>
                       </tr>
                       <?php if($adicional==1){ ?>
                       <tr>
                            <td class="form-field" style="padding-top: 0px; margin-top: 0px;">
                              Periodicidades 
                              <table width="100%" cellpadding="0" cellspacing="0" border="0" class="contentRango">
                              
                                        <tr>
                                            <td class="form-field " style="padding-top: 5px; margin-top: 0px;">
                                                Desde
                                                <div class="clear"></div>
                                                <?php echo $filtro['desde'] ?>
                                            </td>

                                            <td class="form-field contentRango" style="padding-top: 5px; margin-top: 0px;">
                                                Hasta
                                                <div class="clear"></div>
                                                <?php echo $filtro["hasta"] ?>
                                            </td>
                                        </tr>
                                        <script>
                                                    $(document).ready(function() {
                                                        $( "#usuario_filters_desde" ).datepicker({
                                                        defaultDate: "+1w",
                                                        changeMonth: true,
                                                        dateFormat: "dd-mm-yy",
                                                        onClose: function( selectedDate ) {
                                                            $( "#usuario_filters_hasta" ).datepicker( "option", "minDate", selectedDate );
                                                        }
                                                        });
                                                        $( "#usuario_filters_hasta" ).datepicker({
                                                        defaultDate: "+1w",
                                                        changeMonth: true,
                                                        dateFormat: "dd-mm-yy",
                                                        
                                                        onClose: function( selectedDate ) {
                                                            $( "#usuario_filters_desde" ).datepicker( "option", "maxDate", selectedDate );

                                                        }
                                                        });
                                                    });
                                           </script>
                              
                        </table>    
                              <br>
                              LLamadas Programadas 
                              <table width="100%" cellpadding="0" cellspacing="0" border="0" class="contentRango">   
                              
                                        <tr>
                                            <td class="form-field " style="padding-top: 5px; margin-top: 0px;">
                                                Desde
                                                <div class="clear"></div>
                                                <?php echo $filtro['desde_llam'] ?>
                                            </td>

                                            <td class="form-field contentRango" style="padding-top: 5px; margin-top: 0px;">
                                                Hasta
                                                <div class="clear"></div>
                                                <?php echo $filtro["hasta_llam"] ?>
                                            </td>
                                        </tr>
                                        <script>
                                                    $(document).ready(function() {
                                                        $( "#usuario_filters_desde_llam" ).datepicker({
                                                        defaultDate: "+1w",
                                                        changeMonth: true,
                                                        dateFormat: "dd-mm-yy",
                                                        onClose: function( selectedDate ) {
                                                            $( "#usuario_filters_hasta_llam" ).datepicker( "option", "minDate", selectedDate );
                                                        }
                                                        });
                                                        $( "#usuario_filters_hasta_llam" ).datepicker({
                                                        defaultDate: "+1w",
                                                        changeMonth: true,
                                                        dateFormat: "dd-mm-yy",
                                                        
                                                        onClose: function( selectedDate ) {
                                                            $( "#usuario_filters_desde_llam" ).datepicker( "option", "maxDate", selectedDate );

                                                        }
                                                        });
                                                    });
                                           </script>
                              
                              </table>    
                                </td>

                              </tr>
                              <tr>
                            <td class="form-field" style="padding-top: 0px; margin-top: 0px;">
                                
                                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td>
                                            Ordenar Colonia por:
                                            <div class="clear"></div>
                                            <?php echo $filtro['parroquia_order_by']; ?>
                                            <div class="clear" style="height: 10px"></div>
                                        </td>
                                        <td>
                                           Ordenar Zonas por:
                                            <div class="clear"></div>
                                            <?php echo $filtro['zona_order_by']; ?>
                                            <div class="clear" style="height: 10px"></div> 
                                        </td>
                                        <td>
                                           Ordenar Calle  por:
                                            <div class="clear"></div>
                                            <?php echo $filtro['direccion_order_by']; ?>
                                            <div class="clear"></div>
                                            <div class="clear" style="height: 10px"></div> 
                                        </td>
                                    </tr>
                                </table>
                              
                              
                            </td>
                              </tr>
                              
                              <?php } ?>
            </table>
            
            
            
            
        </td>
    </tr>
    <tr><td class="form-action-bottom">
          <!--BOTON Salvado del formulario-->
          
          <?php echo $filtro->renderHiddenFields(false) ?>
          <input class="button-submit" type="submit" value="Filtrar"  name="formu" id="submit"/>
          <a class="button-done" href="javascript:void(0);" onclick="closeAll();">Cerrar</a>
            <a class="button-resets" href="<?php echo url_for('dashboard/reset'); ?>">Eliminar</a>
        </td></tr>

</table>
</form>                          


<script type="text/javascript">

$('#usuario_filters_municipio_id').change(function(){

              var arrayData = 'municipio_id='+$(this).val(); 
    
              $.ajax({
                    url: '<?php echo url_for("cliente/searchColoniaSelectFiltros")?>',
                    data: arrayData,
                    dataType: "script",
                    type: "POST",
                    success: function(theResponse){ 
                        $("#busquedaColonia").html(theResponse);
                    }});

});


function coloniaSelect(parroquia_id,municipio_id){
    
    var arrayData = 'municipio_id='+municipio_id+
                    '&parroquia_id='+parroquia_id; 
                 
                 $.ajax({
                    url: '<?php echo url_for("cliente/searchColoniaSelectFiltros")?>',
                    data: arrayData,
                    dataType: "script",
                    type: "POST",
                    success: function(theResponse){ 
                        $("#busquedaColonia").html(theResponse);

                    }});

    }



</script>